/**
 * 批注相关类型定义
 */

/**
 * 批注作者信息
 */
export interface CommentAuthor {
  id: string;
  name: string;
  avatar?: string;
  color?: string;
}

/**
 * 点赞信息
 */
export interface CommentLike {
  userId: string;
  type: "like" | "dislike"; // 点赞或点踩
  createdAt: string;
}

/**
 * 引用回复信息
 */
export interface CommentQuote {
  replyId: string;
  authorName: string;
  content: string;
}

/**
 * @提及信息
 */
export interface CommentMention {
  userId: string;
  userName: string;
  position: number; // 在内容中的位置
}

/**
 * 批注回复
 */
export interface CommentReply {
  id: string;
  content: string;
  author: CommentAuthor;
  createdAt: string;
  updatedAt?: string;
  likes?: CommentLike[]; // 点赞列表
  likeCount?: number; // 点赞数
  dislikeCount?: number; // 点踩数
  quote?: CommentQuote; // 引用回复
  mentions?: CommentMention[]; // @提及列表
  isEdited?: boolean; // 是否已编辑
  isDeleted?: boolean; // 是否已删除
  deletedAt?: string; // 删除时间
  deletedBy?: string; // 删除者ID
}

/**
 * 批注位置信息
 */
export interface CommentPosition {
  from: number;
  to: number;
}

/**
 * 批注数据结构
 */
export interface Comment {
  id: string;
  content: string;
  author: CommentAuthor;
  createdAt: string;
  updatedAt?: string;
  resolvedAt?: string;
  resolvedBy?: string;
  isResolved: boolean;
  replies?: CommentReply[];
  position: CommentPosition;
  isInvalid?: boolean; // 标记位置是否失效
}

/**
 * Comment Mark 的属性
 */
export interface CommentAttributes {
  commentId: string;
  authorId?: string;
  resolved?: boolean;
}

